package com.example.newland.myapplication;

import android.content.Context;
import android.graphics.Canvas;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    private ChartView chartview;
    private float temp;
    private float hum;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        chartview=findViewById(R.id.chartView);
    }

    public void addData(View view) {
        temp=temp+2;
        hum=hum+4;

        chartview.addData(temp,hum);
    }
}
